]> git.r.bdr.sh - rbdr/super-polarity/blobdiff - Super Polarity/SuperPolarity.cs
Moves to ActorManager arch + Actor Inherited stuff
[rbdr/super-polarity] / Super Polarity / SuperPolarity.cs
index c43582eda87f868913b405e0824ad6f8db0e3eb7..e5f565bd23d874bde0f6bb02e82b683e70f6cda3 100644 (file)
@@ -20,18 +20,13 @@ namespace SuperPolarity
         public static GraphicsDeviceManager graphics;
         SpriteBatch spriteBatch;
 
-        // Input Handler
-        KeyboardState currentKeyboardState;
-        GamePadState currentGamePadState;
-
-        MainShip player;
-
         public SuperPolarity()
             : base()
         {
             SuperPolarity.graphics = new GraphicsDeviceManager(this);
             SuperPolarity.graphics.PreferMultiSampling = true;
             Content.RootDirectory = "Content";
+            ActorFactory.SetContentManager(Content);
         }
 
         /// <summary>
@@ -42,8 +37,6 @@ namespace SuperPolarity
         /// </summary>
         protected override void Initialize()
         {
-            player = new MainShip();
-
             base.Initialize();
         }
 
@@ -58,7 +51,7 @@ namespace SuperPolarity
 
             Vector2 playerPosition = new Vector2(GraphicsDevice.Viewport.TitleSafeArea.X, GraphicsDevice.Viewport.TitleSafeArea.Y + GraphicsDevice.Viewport.TitleSafeArea.Height / 2);
 
-            player.Initialize(Content, Content.Load<Texture2D>("Graphics\\main-ship"), playerPosition);
+            ActorFactory.CreateMainShip(playerPosition);
         }
 
         /// <summary>
@@ -83,7 +76,7 @@ namespace SuperPolarity
             // TODO: Add your update logic here
 
             InputController.UpdateInput();
-            player.Update(gameTime);
+            ActorManager.Update(gameTime);
 
             base.Update(gameTime);
         }
@@ -98,7 +91,7 @@ namespace SuperPolarity
 
             spriteBatch.Begin();
 
-            player.Draw(spriteBatch);
+            ActorManager.Draw(spriteBatch);
 
             spriteBatch.End();